
public class Transition
{
	private State to;
	
	private Guard guard;
	private Sync sync;
	private Update update;
	
	public Transition(State to)
	{
		this.to = to;
		
		guard = new Guard();
	}
	
	/*
	 * Blocks and waits to be sync'ed.
	 */
	public void sync()
	{
		sync.synchronize();
	}
	
	/*
	 * Check if guard is satisfied.
	 */
	public boolean guard()
	{
		return guard.checkGuard();
	}
	
	/*
	 * Updates the variables.
	 */
	public void update()
	{
		update.doUpdate();
	}

	public void setUpdate(Update update) {
		this.update = update;
	}

	public void setGuard(Guard guard) {
		this.guard = guard;
	}

	public void setSync(Sync sync) {
		this.sync = sync;
	}
}
